<?php

define('SMARTY_DIR','./smarty/');
require_once SMARTY_DIR . 'Smarty.class.php';

$smarty = new Smarty;
$smarty->compile_check = true;
$smarty->debugging = false;
$smarty->addPluginsDir('./cf/components/');

set_include_path( 
	get_include_path() . PATH_SEPARATOR .
	dirname(__FILE__) . PATH_SEPARATOR .
	dirname(__FILE__).'/cf'
);

date_default_timezone_set('UTC');
setlocale(LC_ALL,"en_US.utf8");

require_once 'init.inc';
require_once 'page.inc';


Page::useFriendlyURLs(Page::USE_HIERARCICAL_FRIENDLY_URLS);

function show($template, $name, $crumbs=array(), $title='', $keywords='', $descr='')
{
	global $smarty, $lang;

	$smarty->assign('name',$name);
	$smarty->assign('crumbs',$crumbs);
	$smarty->assign('title',$title);
	$smarty->assign('keywords',$keywords);
	$smarty->assign('descr',$descr);
	
	$smarty->assign('tpl', "$template.tpl");

	$smarty->display('main.tpl');
}

$smarty->assign('topMenu',Pages::toHierarchyTree());
?>